#ifndef EMCPOSECLASS_H
#define EMCPOSECLASS_H
//#include "emcpose.h"

#include "emcpos.h"
#include "posemath.h"

typedef enum {
    EMCPOSE_ERR_OK = 0,
    EMCPOSE_ERR_FAIL = -1,
    EMCPOSE_ERR_INPUT_MISSING = -2,
    EMCPOSE_ERR_OUTPUT_MISSING = -3,
    EMCPOSE_ERR_ALL
} EmcPoseErr;

class EmcPoseClass
{
public:
    EmcPoseClass();


    static void emcPoseZero(EmcPose * const pos);

    static int emcPoseAdd(EmcPose const * const p1, EmcPose const * const p2, EmcPose * const out);
    static int emcPoseSub(EmcPose const * const p1, EmcPose const * const p2, EmcPose * const out);

    static int emcPoseToPmCartesian(EmcPose const * const pose,
            PmCartesian * const xyz, PmCartesian * const abc, PmCartesian * const uvw);
    static int pmCartesianToEmcPose(PmCartesian const * const xyz,
            PmCartesian const * const abc, PmCartesian const * const uvw, EmcPose * const pose);

    static int emcPoseSelfAdd(EmcPose * const self, EmcPose const * const p2);
    static int emcPoseSelfSub(EmcPose * const self, EmcPose const * const p2);

    static int emcPoseSetXYZ(PmCartesian const * const xyz, EmcPose * const pose);
    static int emcPoseSetABC(PmCartesian const * const abc, EmcPose * const pose);
    static int emcPoseSetUVW(PmCartesian const * const uvw, EmcPose * const pose);

    static int emcPoseGetXYZ(EmcPose const * const pose, PmCartesian * const xyz);
    static int emcPoseGetABC(EmcPose const * const pose, PmCartesian * const abc);
    static int emcPoseGetUVW(EmcPose const * const pose, PmCartesian * const uvw);

    static int emcPoseMagnitude(EmcPose const * const pose, double * const out);

    static int emcPoseValid(EmcPose const * const pose);
};

#endif // EMCPOSECLASS_H
